﻿using System.Windows.Input;
using DevExpress.Mvvm;
using EduAssess.Services;
using EduAssess.Views;

namespace EduAssess.ViewModels;

public class StartPageViewModel(PageNavigationService navigationService, TestService testService, TestState testState)
    : BindableBase
{
    public ICommand OpenTestsListCommand => new DelegateCommand(() =>
    {
        navigationService.Navigate(new TestListPage());
    });

    public ICommand CreateTestCommand => new DelegateCommand(() =>
    {
        testState.CurrentTest = null;
        navigationService.Navigate(new CreateTestPage());
    });

    public ICommand ExitCommand => new DelegateCommand(() =>
    {
        System.Windows.Application.Current.Shutdown();
    });
}